<template>
  <div>
    <p>{{ a }}</p>
  </div>
</template>
<script>
import { ref, reactive, onMounted } from 'vue';
export default {
  setup() {
    const state = reactive({
      a: 99,
    });
    onMounted(() => {
      //生命周期-挂载完成
      setInterval(function () {
        state.a += 10;
      }, 1000);
    });
    return state;
  },
};
</script>
